<html>

<header></header>
<script type="text/javascript" src="/public/jquery-2.1.1.min.js"></script>
<script src="/public/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/public/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<script src="/public/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="/public/datetimepicker/css/bootstrap-datetimepicker.min.css">
<body>
<div class="container">
    <form class="form-inline" style="margin-top:10px;">
        <div class="form-group">
            <label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label>
            <div class="input-group">
                <input size="16" type="text" name="month" value="" autocomplete="off" class="form_datetime form-control" id="exampleInputAmount">
<!--                <input type="month" name="month" class="form-control" id="exampleInputAmount" placeholder="Amount">-->
            </div>
        </div>
        <button type="submit" class="btn btn-primary">按月搜索</button>
    </form>

    <div class="table-responsive">
        <table class="table table-hover">
            <tr>
                <th>#</th>
                <th>日期</th>
                <th>店铺</th>
                <th>操作</th>
            </tr>
            <?php foreach($result as $key =>$value){ ?>
            <tr>
                <td><?php echo $key+1; ?></td>
                <td><?php echo $value['date_time']; ?></td>
                <td><?php echo $value['store']; ?></td>
                <td><a href="https://<?php echo $_SERVER['HTTP_HOST']; ?>/export/download?date=<?php echo $value['date_time']; ?>&store=<?php echo $value['store']; ?>">下载</a></td>
            </tr>
            <?php } ?>

        </table>
    </div>
</div>
</body>
</html>
<script>
    //日期插件
    $(".form_datetime").datetimepicker({
        format: 'yyyy-mm',//显示格式
        todayHighlight: 1,//今天高亮
        minView: "month",//设置只显示到月份
        startView:2,
        forceParse: 0,
        showMeridian: 1,
        autoclose: 1//选择后自动关闭
    });
</script>
